package com.gxdf.extendedcontrols.gxdfclient.data;


import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.artech.R;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.maps.MapView;
 
public class GxdfMapFragment extends DialogFragment {
	
	GoogleMap map;
	private SupportMapFragment fragment;
	

	

	@Override
	public void onActivityCreated(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onActivityCreated(arg0);
		
		/*fragment = ((SupportMapFragment) getFragmentManager().findFragmentById(R.id.gxdfmapview));
		
		map = fragment.getMap();*/		
		
		FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
        //transaction.add(R.id.gxdfmapview1, SupportMapFragment.newInstance()).commit();
	}




	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		
	}
	
	
	
	/*private void configurarMapa() {

		map.setMyLocationEnabled(true);
		LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
		Criteria criteria = new Criteria();
		String provider = locationManager.getBestProvider(criteria, true);

		Location myLocation = locationManager.getLastKnownLocation(provider);

		if (myLocation != null) {
			map.setMapType(GoogleMap.MAP_TYPE_HYBRID);
			double lat = myLocation.getLatitude();
			double lon = myLocation.getLongitude();
			LatLng latlng = new LatLng(lat, lon);

			map.moveCamera(CameraUpdateFactory.newLatLng(latlng));
			map.animateCamera(CameraUpdateFactory.zoomTo(20));
			map.addMarker(new MarkerOptions().position(new LatLng(lat, lon))
					.title("Usted se encuentra aqui"));
		}
	}*/




	



		
	
	
	
	
	

}
